home *** CD-ROM | disk | FTP | other *** search
/ CD Ware Multimedia 1995 May / cd Ware (Juegos) Epimundo.iso / WIN / VB_DB / PROFIT.ZIP / SUPFILBT.BAS < prev    next >
Encoding:
BASIC Source File  |  1992-12-16  |  3.8 KB  |  123 lines

  1.    '******************************************************
  2.    '*    Supplier File type                              *
  3.    '******************************************************
  4.  
  5.     Type SupplierType
  6.         SupplierNo       As String * 3
  7.         SupplierDesc     As String * 30
  8.     End Type
  9.  
  10.     Global SupplierRec As SupplierType
  11.     Global SupplierSaveRec As SupplierType
  12.     Global SupplierSt%
  13.     Global SupplierKeyB$
  14.     Global SupplierPosBlk As PosBlk
  15.  
  16. Sub CloseSupplierFile ()
  17.   '********** Close Supplier file **********************
  18.     SupplierKeyBufLen% = 255
  19.     SupplierBufLen% = Len(SupplierRec)
  20.     KeyNum% = 0
  21.     SupplierSt% = 0
  22.     SupplierSt% = btrcall(BCLOSE, SupplierPosBlk, SupplierRec, SupplierBufLen%, SupplierKeyB$, SupplierKeyBufLen%, KeyNum%)
  23. End Sub
  24.  
  25. Sub DeleteSupplier ()
  26.       SupplierKeyBufLen% = 255
  27.       SupplierBufLen% = Len(SupplierRec)
  28.       KeyNum% = 0
  29.       SupplierSt% = 0
  30.       SupplierSt% = btrcall(BDELETE, SupplierPosBlk, SupplierRec, SupplierBufLen%, SupplierKeyB$, SupplierKeyBufLen%, KeyNum%)
  31. End Sub
  32.  
  33. Sub FirstSupplier ()
  34.   If Len(SupplierKeyB$) <> 3 Then
  35.     SupplierKeyB$ = String$(3, " ")
  36.   End If
  37.   SupplierKeyBufLen% = 255
  38.   SupplierBufLen% = Len(SupplierRec)
  39.   KeyNum% = 0
  40.   SupplierSt% = 0
  41.   SupplierSt% = btrcall(BFIRST, SupplierPosBlk, SupplierRec, SupplierBufLen%, SupplierKeyB$, SupplierKeyBufLen%, KeyNum%)
  42. End Sub
  43.  
  44. Sub MsgSupplierNotFound ()
  45.   Msg$ = "Supplier not found.  Status = " + Str$(SupplierSt%)
  46.   T1% = MsgBox(Msg$, 0, "Warning!")
  47. End Sub
  48.  
  49. Sub MsgSupplierNotOpen ()
  50.         Msg$ = "Supplier file not opened."
  51.         T1% = MsgBox(Msg$, 0, "Warning!")
  52. End Sub
  53.  
  54. Sub MsgUnknownSupplierError ()
  55.   Msg$ = "Supplier file error.  Status = " + Str$(SupplierSt%)
  56.   T1% = MsgBox(Msg$, 0, "Warning!")
  57. End Sub
  58.  
  59. Sub NextSupplier ()
  60.   If Len(SupplierKeyB$) <> 3 Then
  61.     SupplierKeyB$ = String$(3, " ")
  62.   End If
  63.   SupplierKeyBufLen% = 255
  64.   SupplierBufLen% = Len(SupplierRec)
  65.   KeyNum% = 0
  66.   SupplierSt% = 0
  67.   SupplierSt% = btrcall(BNEXT, SupplierPosBlk, SupplierRec, SupplierBufLen%, SupplierKeyB$, SupplierKeyBufLen%, KeyNum%)
  68. End Sub
  69.  
  70. '
  71. '
  72. Sub OpenSupplierFile ()
  73.   
  74.   '******** Open Supplier File ********************
  75.     SupplierKeyB$ = "suppfile.btr"
  76.     SupplierKeyBufLen% = 255
  77.     SupplierBufLen% = Len(SupplierRec)
  78.     KeyNum% = 0
  79.     SupplierSt% = 0
  80.     SupplierSt% = btrcall(BOPEN, SupplierPosBlk, SupplierRec, SupplierBufLen%, SupplierKeyB$, SupplierKeyBufLen%, KeyNum%)
  81.     If SupplierSt% <> 0 Then
  82.       Msg$ = "Supplier file open failed. Status = " + Str$(SupplierSt%)
  83.       T1% = MsgBox(Msg$, 0, "Warning!")
  84.     End If
  85. End Sub
  86.  
  87. Sub PreviousSupplier ()
  88.   If Len(SupplierKeyB$) <> 3 Then
  89.     SupplierKeyB$ = String$(3, " ")
  90.   End If
  91.   SupplierKeyBufLen% = 255
  92.   SupplierBufLen% = Len(SupplierRec)
  93.   KeyNum% = 0
  94.   SupplierSt% = 0
  95.   SupplierSt% = btrcall(BPREVIOUS, SupplierPosBlk, SupplierRec, SupplierBufLen%, SupplierKeyB$, SupplierKeyBufLen%, KeyNum%)
  96. End Sub
  97.  
  98. Sub ReadSupplier ()
  99.     SupplierKeyB$ = SupplierRec.SupplierNo
  100.     SupplierKeyBufLen% = 255
  101.     SupplierBufLen% = Len(SupplierRec)
  102.     KeyNum% = 0
  103.     SupplierSt% = 0
  104.     SupplierSt% = btrcall(BEQUAL, SupplierPosBlk, SupplierRec, SupplierBufLen%, SupplierKeyB$, SupplierKeyBufLen%, KeyNum%)
  105. End Sub
  106.  
  107. Sub UpdateSupplier ()
  108.     SupplierKeyBufLen% = 255
  109.     SupplierBufLen% = Len(SupplierRec)
  110.     KeyNum% = 0
  111.     SupplierSt% = 0
  112.     SupplierSt% = btrcall(BUPDATE, SupplierPosBlk, SupplierRec, SupplierBufLen%, SupplierKeyB$, SupplierKeyBufLen%, KeyNum%)
  113. End Sub
  114.  
  115. Sub WriteSupplier ()
  116.       SupplierKeyBufLen% = 255
  117.       SupplierBufLen% = Len(SupplierRec)
  118.       KeyNum% = 0
  119.       SupplierSt% = 0
  120.       SupplierSt% = btrcall(BINSERT, SupplierPosBlk, SupplierRec, SupplierBufLen%, SupplierKeyB$, SupplierKeyBufLen%, KeyNum%)
  121. End Sub
  122.  
  123.